package com.zhongwang.business.common;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 *  json 返回结果封装， 用于 ajax 请求返回的结果包装
 *
 * @author China.sgl
 * @date 2019/9/9 13:14
 */
@Data
@AllArgsConstructor
public class ValidResult {

    private boolean valid;

    public static ValidResult SUCCESS = new ValidResult(true);
    public static ValidResult FAIL = new ValidResult(false);

    public static ValidResult result(Object o) {
        if (o == null) {
            return SUCCESS;
        }
        return FAIL;
    }

}
